<?php

$user_id = $_SESSION['user_id'];
$username = $_SESSION['userName'];	
$password = $_SESSION['passWord'];
$randompass = $_SESSION['randomPass'];

if( 0 != $user_id ){
	$sql = 'SELECT * FROM `'.DB_PRE.'user` WHERE `id` = '. $user_id .' and `userName` = "'. $username .'" and `passWord` = "'. $password .'" and `randomPass` = "'. $randompass .'" ';
	$user = $dbs -> select($sql);
	$user = $user[0];	
	$myInfo = $user ;
	if( 0 != count($user) ){
		initUserLogin($user);
	}
	$user = new users();
	
	$userStatus = $user -> getUser('');
	$userStatus = $userStatus['status'];
	if( $userStatus <= 0 ){
		header('Location:'. urlRewrite('option=userLock'));
		exit();
	}
}else{
	$user = new users ;
}

?>